package cn.itsource.blog.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import org.springframework.data.mongodb.core.mapping.FieldType;

import java.util.Date;

@Data
@Document(collection = "t_article") //对应mongodb的集合t_article
public class Article {
    @Id
    private String _id;
    private Long id;
    private String articlePic;
    @Field(name = "article_name",targetType= FieldType.STRING)
    private String articleName;
    private String articleTag;
    private Long articleType;
    private Integer articleState;
    private Integer topState;
    private Long publishId;

    private Date createTime = new Date();
    private Date updateTime;
    private Integer articleReadCount = 0;
    private Integer articleStarNum = 0;
    private Integer articleCommentNum = 0;
    private String articleRemark;
    private String articleContent;

    //保存当前文章的文章类型的名称
    private String articleTypeName;
    //保存当前发布人的名称
    public String publishName;
}
